package com.bawei.module_mall.http.api

import com.bawei.lib_common.entity.ResponseEntity
import com.bawei.module_mall.model.AddAddressModel
import com.bawei.module_mall.model.AddShopModel
import com.bawei.module_mall.model.AddressModel
import com.bawei.module_mall.model.CityModel
import com.bawei.module_mall.model.CollectModel
import com.bawei.module_mall.model.CommentModel
import com.bawei.module_mall.model.DeleteModel
import com.bawei.module_mall.model.GetShopModel
import com.bawei.module_mall.model.HomeModel
import com.bawei.module_mall.model.IDModel
import com.bawei.module_mall.model.ProvincesModel
import com.bawei.module_mall.model.RequestSearchGoodsModel
import com.bawei.module_mall.model.SearchGoodsModel
import com.bawei.module_mall.model.ShopDetailModel
import com.bawei.module_mall.model.ShopNumberModel
import com.bawei.module_mall.model.UpdateModel
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query
import kotlin.jvm.internal.Ref

interface ShopApiService {

    @POST("/mall/userAddress/add")
    suspend fun postAddAddress(@Body body: AddAddressModel): ResponseEntity<Boolean>

    @POST("/mall/userAddress/list")
    suspend fun getAddress(): ResponseEntity<AddressModel>

    @GET("/mall/userAddress/provinces")
    suspend fun getAddressProvince(): ResponseEntity<ProvincesModel>

    @GET("/mall/userAddress/byProvince/{provinceId}")
    suspend fun getAddressCity(@Path("provinceId") provinceId: String): ResponseEntity<CityModel>

    @GET("/mall/userAddress/byCity/{cityId}")
    suspend fun getAddressHome(@Path("cityId") cityId: String): ResponseEntity<HomeModel>

    @POST("/mall/userAddress/update")
    suspend fun updateAddress(@Body body: UpdateModel): ResponseEntity<Boolean>

    @DELETE("/mall/userAddress/delete/{addressId}")
    suspend fun deleteAddress(@Path("addressId") id: Int): ResponseEntity<Boolean>


    @GET("/mall/goodsDetail/mallGoodsInfoInfo/{goodsId}")
    suspend fun getShopDetail(@Path("goodsId") goodsId: Int): ResponseEntity<ShopDetailModel>
    //添加购物车
    @POST("/mall/shoppingCart/addShoppingCar")
    suspend fun addShop(@Body body: AddShopModel): ResponseEntity<Boolean>
    //查询购物车列表
    @GET("/mall/shoppingCart/orderShoppingCartList")
    suspend fun getShop(): ResponseEntity<GetShopModel>
    //添加收藏
    @POST("/mall/goodsCollect/toggle/{goodsId}")
    suspend fun toggleCollect(@Path("goodsId") goodsId: Int): ResponseEntity<Boolean>
    //收藏状态
    @GET("/mall/goodsCollect/check/{goodsId}")
    suspend fun checkCollect(@Path("goodsId") goodsId: Int): ResponseEntity<Boolean>
    @GET("/mall/goodsCollect/view")
    suspend fun getCollect(): ResponseEntity<CollectModel>
    //删除购物车
    @POST("/mall/shoppingCart/delete")
    suspend fun deleteShop(@Body body : DeleteModel): ResponseEntity<Boolean>
    //查询购物车数量
    @GET("/mall/shoppingCart/orderShoppingCartNum")
    suspend fun getShopNumber() : ResponseEntity<Int>
    //更新购物车数量
    @POST("/mall/shoppingCart/update")
    suspend fun updateShopNumber(@Body body: ShopNumberModel) : ResponseEntity<Boolean>
    //获取购物车评论
    @GET("/mall/goodsComment/page/{goodsId}")
    suspend fun getComment(@Path("goodsId")goodsId:Int,@Query("pageNum")pageNum:Int,@Query("pageSize")pageSize:Int):ResponseEntity<CommentModel>
    //获取商品id
    @GET("/mall/goodsDetail/ids")
    suspend fun getGoodsIds(): ResponseEntity<IDModel>




    /**
     * 查看我的橱窗
     */
    @GET("/mall/goodsShow/viewShowedGoods")
    suspend fun viewShowedGoods():ResponseEntity<SearchGoodsModel>

    /**
     * 商品推荐
     */
    @POST("/mall/goodsShow/searchGoods")
    suspend fun searchGoods(@Body body: RequestSearchGoodsModel): ResponseEntity<SearchGoodsModel>

    /**
     *检查商品是否加入橱窗状态
     */
    @GET("/mall/goodsShow/check/{goodsId}")
    suspend fun checkGoods(@Path("goodsId")goodsId:Int):ResponseEntity<Boolean>

    /**
     * 加入-取消加入橱窗
     */
    @POST("/mall/goodsShow/toggle/{goodsId}")
    suspend fun toggleGoods(@Path("goodsId")goodsId:Int):ResponseEntity<Boolean>

    /**
     * 搜索商品
     */
    @POST("/mall/mallSearch/searchGoods")
    suspend fun queryGoods(@Body body:RequestSearchGoodsModel):ResponseEntity<SearchGoodsModel>


}